import request from '@/utils/axios';

interface IResponseType<P = {}> {
    code?: number;
    msg: string;
    data: P;
}

export const list = (directoryId : number)=>{
    return request<IResponseType>({
        url: '/file/list',
        method: 'get',
        params: { directoryId: directoryId }
    });
}

export const upload = (formData: FormData)=>{
    return request<IResponseType>({
        url: '/talk/upload',
        method: 'post',
        data: formData
    });
}
export const add = (formData: FormData)=>{
    return request<IResponseType>({
        url: '/famous/add',
        method: 'post',
        data: formData
    });
}
export default { list,upload,add };